import Vue from 'vue'
import VueRouter from 'vue-router'
import element from '@/views/element.vue'
import echarts from '@/views/echarts.vue'
import leaflet from '@/views/leaflet.vue'
import cesium from '@/views/cesium.vue'
import three from '@/views/three.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: 'element' //重定向到首页
  },
  {
    path: '/element',
    name: 'element',
    component: element
  },
  {
    path: '/echarts',
    name: 'echarts',
    component: echarts
  },
  {
    path: '/leaflet',
    name: 'leaflet',
    component: leaflet
  },
  {
    path: '/cesium',
    name: 'cesium',
    component: cesium
  },
  {
    path: '/three',
    name: 'three',
    component: three
  }
]

const router = new VueRouter({
  routes
})

export default router
